-Fixed $.promise
-Cleaned up JS
-Moved JS to separate file