Added javadocs and more tests.