Misc output cleanup and a test run script.
Cleaning up function creation.