Moved all utility functions into utils.py, tests now reference them from here; no duplicated code