Added basic tests for admin script

Extracted window.onLoad event from admin script to the admin page
itself.