Add support for also mapping route params to functions for processing

Now both regexps and functions are supported for route param formatting
and validation.