Refactor code to use through2 and emit error events
Add test for ejs included files