Refactoring, Adding Testing, Cleaning up JS files