Use dirname instead of basename. Differentiate between mv and ln.

I removed this line because I couldn't tell what the missing function `hermit_add_file` would have done that `hermit-add` doesn't do with my additions.