port library to use NAN

fix #33