Added javadoc comments to much of the API