Clean up handlers and routes.

Move handlers out into their own module, and put the url routes into a
list so it's easier to add to.