Modularize routing

Separates:
* tracking middleware
* v1 routes
* v2 routes
* common definitions