Start breaking out the code into a proper lib dir