Handle dots and slashes more correctly in getPath

cc @darach @rvagg
v0.2.5