Switch from using eval() to require() for loading endpoints

Use require() instead of eval() by hooking into the require method (via [istanbul](https://github.com/gotwarlost/istanbul)) and exporting the `onRequest` method properly.