Move cd into term.
For certain commands, pass the cwd in.
Redo programs to use cwd.