Add support for OS X

Since OS X doesn't support the `-D` install option, we use `-d` to create a directory, followed by the file that needs to be moved there.