a fast implementation of node's native path