Refactor SqlitePostDb's get() code.

This refactor will make it easier to implement retrieval for other post types, and will make it significantly easier to implement multi-post retrieval--multi-post retrieval can now be implemented by simply changing the SQL query, with no code changes required.