Add javadoc generation and fix javadoc warnings.