Use NAN for compatibility with Node 0.11+

Use the [NAN](https://github.com/rvagg/nan) module to get this working with the new version of node.
This is really the only hacky part.