Moved the script into a module and added setup.py