Turned python code into a proper module.