Start and document the library package, and fix some tests