Moving useful functions to util.py, but am going to hold off on moving main; there's another pull request that bundles everything up into a framework...