Update express middleware for express.io

Express.io does not use the response object, so in the middleware the second argument will be the "next()" function. This fix allows it to use orm with express.io.
Merge pull request #413 from kyjan/patch-1

Update express middleware for express.io