naturally when i actually tested it, it turned out to be subtly broken also reorg'd the tests a bit, sorry @hillerstorm.
npm test now does... something somewhat useful. now to write a bunch of tests.