Fix build with node 0.11.x

Need to detect newer versions of node and switch function calls there too.