Added javadocs and checkstyle.