Set up library project and move shared code into library project