Improvements, hopefully

* update handling of the location id - now sections and such are not encoded,
instead only the paragraph number is
* add image.onload to update scroll position after images are loaded