Refactor code to be async, and improve usability

- use the recommended gulp-util
- better error throwing
- fix tests