Fix utils.db_queries and utils.update

The utils.update part of this PR is not necessary for the tests to work, it's more of a NTH since I ran into it...
This seems a little subversive. Shouldn't it be using the context manager? I think I'd rather see Db get `__enter__` and `__exit__` methods instead of poking around inside the `contextmanager` decorator's internals. Another option is to make database_on_server a normal function, and add a separate context manager to use where we need it.