Adds function for changing basepath dynamically. [f:4h]

This also changes the way routes are declared
(should now be included in the config object).
This also adds test for the changePath function.