Wrap clickAdder() in timeout call for ongoing_edit

When a force login is in effect H removes all annotations and reloads them. In the reload process if the clickAdder() call is happenning too soon then an empty reference will be put in a heatmap bucket instead of the newly created annotation, thus resulting a "zombi" in the Viewer.

This may help for #881
Merge pull request #888 from hypothesis/880-uppercase-user-search-fail

Lookup exact username from the db for stream-search
Update dom-text-mapper to f5988cee
Work around a race condition on loading

There were some cases when we tried to reload the annotations
(upon detecting auth state) even before the store plugin
was initialized, and this caused an error message.

This check works around this problem.

Fixes #899.
Add my annotations link under user account menu in sidebar.
Added fix for github issue 885, and fixed another bug I found whereby a long string of characters unbroken by white space wouldn't wrap on the stream page.
Workaround for one of the problems seen in #899
If sidebar is closed, display flash messages in the host frame

In sidebar:
 * Save our H instance as window.annotator
 * Add isOpen() method to test if the sidebar is open
 * Removed unused draft dependency from controller

In host document:
 * Add support for showing the flash messages
 * Save the Annotator class as @Annotator
 * Redefine the notification level constants in Annotator.Notification
   so that they are consistent with the ones used in the sidebar

Flash message service:
 * Add workaround for duplicate "invalid uname or pw" error message,
   and also swallow the "your submission was invalid" in this case.
 * When the sidebar is closed, pass the message to the host frame
   instead.

Fixes #886.
Merge pull request #902 from hypothesis/886-flash-over-host-2

If sidebar is closed, display flash messages in the host frame
Emit an 'annotatorReady' event when guest functions become available
Added CodeAuth plugin, which can expose user authentication functions from the host/guest side

If you load this plugin (which is disabled by default), these methods
can be used for integrating H login mechanism with code living
on the host page:

 * annotator.getLoginStatus()
 * annotator.loginWithUsernameAndPassword(username, password)
 * annotator.logout()
 * annotator.registerUser(username, email, password)

These all return promises.

Furtheremore, the following events have been introduced:

 * annotatorLogin, upon successfull login
 * annototorLogout, upon log out

Note: these events are *not* fired in cases when the events were
triggered by a call from the given host/guest-side annotator instance;
use the promises to react those events. The events only happen if
these events were triggered from the sidebar, or from other host/guest
frames.
Merge pull request #903 from hypothesis/882-login-from-code-3

CodeAuth plugin (user authentication functions for host side)
Revert "Merge pull request #903 from hypothesis/882-login-from-code-3"

This reverts commit ba92681d2fed403a00b49e13697b13aa37e0e855, reversing
changes made to 71dd9111bad26d5d4235ecdd1b42c60591cd2f35.
Added PDF support - we can now annotate PDF documents

 * Update dom-text-mapper to fcd26632 (master branch)
 * Update dom-text-matcher to fcd26632 (master branch)
 * Update Annotator to f1e08bdd (maintenance branch)

 * Updated assets.py for the changed Annotator files and libraries
 * Updated JSChannel with a patch to allow talking to pdf.js
 * Updated our code to follow Annotator API changess
 * Updated the heatmap for two-phase anchoring and virtual anchors

The change in embed.txt fixes a sporadic code insertation problem.

For pages with no script tags, our embed script sometimes crashed.
I have already fixed this problem for YepNope (see #607), but now
it has come back in our own code.

I am not sure why have not this happened before,
but it definitely was happening now.

I applied the same fix that worked with YepNope. It worked again.
Merge pull request #904 from hypothesis/757-pdfjs-support-8

Added PDF support - we can now annotate PDF documents
Fix merging artifact
Merge pull request #901 from RawKStar77/742-addmyannotationslink

Add my annotations link under user account menu in sidebar.
Update Annotator's PDF plugin to 323e71bc

This version delays the PDF scanning until the document is ready.

Fixes #892.
Update Annotator's PDF plugin to 909ccab15

This version fixes another race condition during initialization.

Hopefully fixes #892 for good.
Update Annotator's PDF plugin to 957c4e9a9

This version fixes yet other race condition during initialization.

Fixes #892. Hopefully, it really stays dead this time.