move library code into lib/