Tests added and javadocs updated.