Updating map fn version clears view index. Also removed more FMDB stuff.
Converted attachment code. Unit tests pass.

Attachment metadata isn't stored separately in the db anymore. Instead,
each revision's JSON keeps its _attachments dictionary (in stub form).