Cleaning up utility functions into a new utils.py; fixed a super() bug; some PEP8 fixes.