Refactoring of several PHP classes and JavaScript libraries to fix formatting, semantics, etc.