Don't match empty path segments
More tests, and use mocha directly