Changes this to a module

Makes it a bit more useful to integrate into other programs