Corrected an issue when creating package.json.

The regular expression used to remove spaces from the name was not
correctly replacing the spaces. This update also replaces the spaces
with a dash rather than an empty string to better follow convention.

Closes Issue #30.