Split source into individual class files. Added docs. Fixed a few jslint issues.