tests; refactor to work on node 0.6 - 0.10