Make storage parts independent of Flask

The ElasticSearch wrapper and models can now be used without running the
flask app. Only the REST API in store.py needs flask.

A few changes were necessary to separate the flasky bits from the
storage part. ElasticSearch configuration was stored in the flask app,
and is now moved to a dictionary `es.config`. When authorization is
enabled, `Annotation.search` needs to know which user to filter the
results for, which was formerly read from `g.user` but must now be
passed as an argument.

Mixing query terms and other `search` arguments (like `limit` and
`offset`) together in `**kwargs` seemed a bit shaky to me (keywords
start overlapping with model fields), especially now `user` is also
passed as a keyword argument. The query is therefore to be passed
explicitly. Search syntax is a bit uglier now, sorry about that:

```python
Annotation.search(user=user,
                  query={'uri':'http://example.com/1234'})
```

In the REST API, query terms are still intermingled with limit and
offset parameters, it is the task of store.py to separate these.
Merge pull request #76 from Treora/flaskless

Make storage parts independent of Flask