Added more JavaDoc and Apache 2.0 license. Also refactored some classes that could be final. General cleanup as well.