test based refactoring and upgrade to node 0.10.x