Refactor API code to use annotator-store flaskless

Everything seems to work: reading, creating, updating, deleting, searching, permissions seem to work but need better testing, and in general more tests and thorough code review would be good.

To keep a consistent style and make refactoring easier, I decided to use traversal with a `@view_defaults` class everywhere, using the defaults class to specify the `context` predicate, so as to group the views within that. For the same reasons I do not use view names but use a resource for each location (I explictly state `name=''` for clarity, though that could be removed). I think this style works out nicely.

I put some questions in the comments, just search for the question marks.

The dependency on the next (flaskless) annotator-store version has yet to be added.

<!---
@huboard:{"order":1346.7445068359375,"milestone_order":1300,"custom_state":""}
-->

The Consumer class is important to keep pluggable because authentication is
an important customization story for us.

WebPlatform uses a Consumer that is only constructed from the .ini and does
not use SQL.
On Nov 5, 2014 6:33 AM, "Nick Stenning" <notifications@github.com> wrote:

> In h/api.py:
>
> >
> > -    def _invoke_subrequest(self, subreq):
> > -        request = self.request
> > +    consumer_ctor = registry.getUtility(interfaces.IConsumerClass)
>
> I know you didn't add the IConsumerClass type, but I find this whole
> pattern somewhat distasteful. The abstract IConsumerClass is implemented
> in exactly one place right now, and the added indirection it creates in
> (for example) get_consumer isn't worth it.
>
> I'd rather we stripped IConsumerClass and just referred directly to
> h.auth.local.models.Consumer where needed.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hypothesis/h/pull/1300/files#r19875849>.
>