Moved functionality that will be useful to other scripts to a new util module.