Added Javadoc, code cleanup and refactoring, prepare for final release