Senate passed spending bill to end government shutdown after complex procedural hurdles and negotiations involving multiple Republican senators.