Set __dst_dir__ in write() instead of cmd()

Tests pass now
Merge pull request #5 from hfinucane/dst_dir_entry

Set __dst_dir__ in write() instead of cmd()