Reorganizing into lib files and starting test helper