Refactor setupEntries and export route

Refactor setupEntries

Export route to use middleware like this
```
    var myapp = express();
    myapp.use(stubcell.route);
    var server = myapp.listen(9000);
```

Require merge [stubrec](https://github.com/yosuke-furukawa/stubrec/pull/1)
I would like to replace the following sentences fo CORS,
to other file.

like 

```javascript
var cors = require('./cors');

if (this.cors) {
  cors.setHeaders(res, cors);
}
```