Move test runner into separate script; travisci seems to barf on trap in sh