Page search uses viewState.sort

Originally page search was not prepared for the sort viewState, now it is.
For this, the applySort() was refactored to use the rootScope instead of the scope and produces both the predicate for the viewer and for the page search

Fixes #1148
Make page search play nice with focus

As for the sort the page search works with threads instead of annotations so the directive should look for either annotation or thread.message in the scope
Page search focuses annotations when it opens them.

Thx @csillag for the help
Add workaround for real-time updates to extend the annotations list if needed

The rootScope.annotations was not refreshed when a new real-time annotation arrived, so for comments and document view we have to insert the annotation there manually

Fixes #1149
Call applySort() at the startup

If not doing this the rootScope.predicate etc. variables are not set and angular silently fails sorting

Fixes #1150
Don't try to flash messages on null host page

This was causing a race condition on app startup. Now, the worst that
happens is the flash message shows in the sidebar.
Default to ES 1.0
Restore search ability for replies

When we sacked the scope search facets and rely on rootScope.annotations the replies were no longer tested as possible search results. It is now restored.
Rename main bundle outputs

This looks a bit better:
  hypothesis.min.js and hypothesis-inject.min.js
Handle SCE better with custom base URI

When we deploy as an extension the application baseURI is the URL
of the backend, rather than the extension. As a result, templates
are relative to this location. Even though we inline the templates
in the extension bundle, we have to ensure the compilation isn't
blocked by strict contextual escaping.
whitespace
Don't copy all libs to extension, just images

This avoids getting all the un-minified js
Add pdf.js as a submodule
Include pdf.js from extension build script

With this change, I have no problem testing a local chrome extension
build.

Close #891
Update extension installation instructions

Closes #1080
Update extension command doc string
Add note to README about building pdf.js
Realtime update added replies to Document view

Since, for document view to had to add the new annotation manually to the rootScope.annotations, we have forgotten to check whether is it a reply or not.
Now replies are not added. The original error also went away when the view(scope) was changed.
Add production.ini and strip down development.ini

The Procfile now uses production.ini which should use a set of sane
defaults and includes more comments to explain what's going on.
Add support mail settings from environment
Prefer environment variable for ES connection