support for generating external routes via request.route_url

this pull request replaces, fixes and builds upon #1101 

- fixes broken tests on python 3
- supports defining external routes in a function included via `config.include(..., route_prefix=...)`
- allows defining a custom pregenerator to `config.add_route(pregenerator=...)`