Fixes #2692: Generator places new routes in the wrong location if the ro...

...uter has been reopened

#2692: Regex match and replace function has been modified so that new
routes are placed at the top of the Router.map(), which eliminates the
possibility of potentially valid code or useful comments breaking the
functionality of the generate command.

Failing test was created to demonstrate the issue. Now passes with 0
regressions.