Add javadoc and more implementations.