Move production code into lib folder