Added Javadocs, cleaned up code.
Fixed all javadoc errors and all warnings except @throw descriptions.