Fixed output to directory issue

- Fixed issue preventing writing one directory into another
- Added tests to cover the main use cases for outputting files
- Bumped version