Replace url-pattern with path-to-regexp

While [url-pattern](https://github.com/snd/url-pattern) works for most cases, [path-to-regexp](https://github.com/component/path-to-regexp) brings some added flexibility, such as optional trailing slashes and named wildcard capture groups.

This patch also allows each route to be specified using `pattern` (RegExp) instead of `path`.