Improve cd-compile to be more convenient

We usually run the same command in the same directory in a project. It
should be cached, so user won't have to re-enter again and again, unless
specified with prefix argument.