Fix stub_instance() to include missing attributes

The stub_instance() function aims to create a fake instance dict,
but omits several attributes present on the real database object.
This patch adds them. While they're not used anywhere (obviously)
at the moment, some WIP code I'm working on expects them to look
like the DB object, and thus fails.

Change-Id: I71fb596f8b0a80de21ee58ef378440da8eea1777
(cherry picked from commit cf2df80daab0df4104368ccc1a62c6e313ac6c8b)
Add a bunch of tests and fix some issues

This reorganizes some tests, provides an easy way to test remoted
methods, and adds tests for some things that were lacking (like
Instance). It also, of course, fixes some things found in the
process.

Change-Id: Iaed711b70af518da3f1445acff005c18d42ab25a