refactor db.Db to be a proxy with storage procedure wrappers
This way, the only code that actually call into remote stored procedures will
be in this module. Other modules will just call into db.Db (in pure Python) and
will not need to touch raw SQL.