better error handling

- Listen for errors from `fstream`
- Error handling in examples
- Missed `mkdirp` dep for tests