Reorder after scan to support late registration of middleware.

Previously, reordering of middleware to place routes in a predicable location didn't take into account late registration of middleware. For example, prior to this change if a scanned file did the following, the middleware would be placed AFTER the route handler in the middleware stack. This change ensures it is placed before express' router. Includes test case.

```javascript
// file1.js
module.exports = function (app) {
    app.use('/foo', myMiddleware);
    app.get('/foo', function (req, res, next) {
        res.send('ok');
    }
};
```