Test / create errors directory before writing to it.

Closes #249.
simplify file structure