Write many tests + minor refactoring of Node module