Finish moving code to lib dir