More Javadoc for the library package, and add a test class