Refactored the admin JS.
Merge pull request #3 from hopeseekr/refactor_admin_js

Refactored the admin JS.