Improved documentation of some classes, minor code cleanups