Library

This make the library build from only the externally needed modules. It also includes a new unittest.