Add javadocs

Added javadocs to most public methods.