Return more metadata from GET /db (including instance_start_time)

Some of it is just stubbed out, at least for now, but it should help
with compatibility with client code that assumes those fields exists
and barfs without them.
Fixes #136
Set "encoded_length" on encoded attachment being stored in the db

Previously the code would change the "length" property to the encoded
length, which is wrong.