Write nrrd works too
Add unit tests. Closes #517