Added loading spinner to UI that toggles off when things are loaded.
Refactored code, cleaned up some stuff, and added YUIDoc commenting.