Set __dst_dir__ in write() instead of cmd()

Tests pass now

In retrospect, I should have written tests for this first.