change tap -> nodeunit and restructure into lib to get sensible coverage