Ensure that tilde is an alias for $HOME

In my `.npmrc`, I have my `prefix` set to:

  prefix = ~/.npm-packages

`npm` recognizes that `~` should be replaced with `process.env.HOME`:

  $ npm config ls
  ; userconfig /home/kenan/.npmrc
  prefix = "/home/kenan/.npm-packages"

But `npmd-config`, however, does not:

  $ npmd-config
  {
    "prefix": "~/.npm-packages"
  }

Which leads to this:

  $ npmd install -g browserify
  {
    "name": "browserify",
    "version": "5.9.1",
    "shasum": "fb4eea5a2e8e855860389f99f4f832918f6e7640",
    "tarball": "http://registry.npmjs.org/browserify/-/browserify-5.9.1.tgz",
    "path": "/home/kenan/Code/temp/~/.npm-packages/lib/node_modules/browserify"
  }

`npmd` globally installs to `CWD/~/.npm-packages` instead!

So I started searching through `npm` to see how this is solved over there, and
I discovered this logic in nopt:

  var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
  if (val.match(homePattern) && process.env.HOME) {
    val = path.resolve(process.env.HOME, val.substr(2))
  }
  data[k] = path.resolve(String(val))

So this patch basically brings this logic to `npmd-config`. I can confirm that
this fixes global installs for me, but frankly I do not know if there's anything
else that should be tested.

Closes #7
Merge pull request #7 from KenanY/map-tilde-to-home

Ensure that tilde is an alias for $HOME