Moved functions into a nice script, run-tests to generate coverage info from tests.