Unbreak standalone

OK, as far as I can tell (from testing using "demo.html"), it is working properly now.
What I could you yet test: saving annotations to back-end. (But that should not broke.)

@tilgovi, if you could give it some testing, I think it could be merged.