Add context manager for db queries.
Add user update function.