Added event before mounting routes for easier e.g. modules configuration 

Unfinished work, have to tweak other elements. Issue #506