Update name script to support import as a module.

Allow importing the `name` script as a Node module for use by other scripts.
The module API follows that of the command line exactly.

Progress on #7.