add gitignore, import nan to support node v0.11.x

import [nan](https://github.com/rvagg/nan) to support node v0.11.x.

test pass in `v0.8.23`, `v0.10.21` and `v0.11.8`