Converted unix code to use nan.h so it works on 0.11.x as well as < 0.11.x