Documented most of the classes and did some minor cleanups in many places.