Route-built-in regex and conversion for handlers

Moves all the regex checking and type conversion boilerplate from the
individual handler implementation and into the router itself. This will
also, rather subtly, allow the router to short-circuit and return a
failure as soon as a segment is known to be bad.