Added Jasmine tests and extra check on erroneous id in url hash.
Addressed further comment.
REVERT THIS COMMIT BEFORE MERGE.