Funding measure gets bipartisan backing after days of bickering on Capitol Hill