Added some more documentation, generated a javadoc.