Now js event registrations only happens on the pages that require them.

Closes #117