Adds exch, which so far checks arguments for validity
Exits on error. Checks write perms on dir. Swaps files.