JS cleanup/edits in assets/javascripts

Some conversion of Prototype code, and general cleanup of code in files in `assets/javascripts`. This folder should be 100% converted after this (and after the React tables are merged in).