[WIP] ORM based dynamic routing

This should be the code to start from