Match prefixes for routes properly in owin handlers.

- Added functional and unit tests.