Move lib code into a lib directory