Refactored into a module. See the test t/00.t for usage information