Major cleaning up JS, and minor to UI