Legislation, which also includes spending cutbacks demanded by House Republicans, sent to US president to be signed into law, averting default