implement the tunable route matching policy

* first match: stop at the first matching route
* longest match: scan all the routes, select the longest match.

default: first match.