Moved some more JS into the page file.
Cleanup.