Added javadoc.
Cleaned up test code.