Changes this to a module

Makes it a bit more useful as something other than a stand alone program.