Add Javadoc for the public interface. Rename some methods to be more consistent.