Made helpers.py and testsource.py pythonic