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.
All the rest of these methods didn't want to run on the persistent function.