Moved scripts into module, refactored setup.py