Getting this to work in Windows as well.

Just a path-separator tweak
[`path.basename`][1]?


[1]: http://nodejs.org/api/path.html#path_path_basename_p_ext