clean up, TODOs after viewing in decent JS editor
miscellaneous clean up

Added function descriptions, switched several objects to constructors
that don't require "new" and don't use "this", fixed indents