Comments, documentation, cleanup

lots of cleanup and some fixes from previous refactor