src: refactor to use nan

- Now it supports latest 0.8.x, 0.10.x and 0.11.x
Version 0.2.1