Bug 1109772 - Refactor bookmarks data access API.

This'll be a non-trivial bunch of work. I'm still hacking away, trying to get the abstractions right. Starting with bookmarks.

Parts 1-7 already merged; parts 8-10 now ready for review.
If the compiler requires a default case that means that the `bookmark` could resolve in something other than `BookmarkItem` or `BookmarkFolder`. Maybe that means the type needs to be more strict? Dunno, maybe that is impractical.