Refactored to python module - will need some pyinstaller magic to make a single file executable