Test cleanup

Added a few unit tests and updated javadoc