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.
It's because the input is a `BookmarkNode`, and so this could be a `BookmarkItem`, a `BookmarkFolder`, or anything that implements `BookmarkNode`.

There's no good syntactic way to show that; if you try `case let thing as BookmarkNode` the compiler will complain "`is` test always true". So `default` here really means "any other kind of `BookmarkNode`".