most refactoring done, jslint validated, error fixes, loading animation