Move worker count to environment variable

There are problems with races creating databases on startup. We could
stop creating them automatically, but it's mighty convenient and its
not easy to run the db creation script otherwise. For instance, in
a dokku the docker links are not available during the buildstep.
Move button construction out of pluginInit
Move plugin buttons within instance context

This makes it possible to call instance methods on the current plugin
from event handlers, without the additional indirection through
window.annotator.
Simplify setVisibleHighlights function

setVisibleHighlights was previously two methods disguised as one, behind
the "notify" parameter. This commit moves all the code related to
actually changing local state into the onSetVisibleHighlights handler,
making the setVisibleHighlights function responsible solely for firing
the event.
Sort orphan placeholders to bottom of stream
Guest#setVisibleHighlights will always toggle highlights
Merge pull request #1623 from hypothesis/stream-orphan-sort

Sort orphan placeholders to bottom of stream
Merge pull request #1622 from hypothesis/simplify-highlights

Simplify highlight visibility toggling.
Handle undefined data on 'auth' event for AuthAppController

When switching tabs on our /login route, the scope.on 'destroy' is
fired in the AuthController which emits an auth event with undefined
data value.

Our AuthAppController was trying to check the data.userid for this
undefined value. We only need to do that when data is undefined.

Fixes #1627
Remove elide filter

This was only used by the old (non-unified) stream template.
Add Jinja2 as the project templating language
Move inject variables into layout
Add a include_raw Jinja extension

This allows us to include raw files directly into templates without
them going through the Jinja processor.
First pass at converting templates to Jinja

Most content is now correctly using Jinja but the rendering in the
sidebar is not working correctly.
Don't insert the ng-csp attribute if unset

Angular will not load correctly if this attribute is present but empty.
Move all angular templates into a client directory
Update the auth template to use Jinja
Remove the home template as it's no longer used
Update the bookmarklet to a Jinja template
Convert pattern library to use Jinja