Take directory as argument to cd-compile.

When called programmatically take the directory as an argument to
cd-compile. If the directory doesn't exist print an error message,
whether called programmatically or interactively.

Fixes #1