Deal to reopen govt, avoid treasury default in works