Various fixes and refactoring

* router fixes
* router feature: parameters are now named instead of being in an ordered array
* coding style fixes