move api to new version and add tests

Because node(V8) have not the real constants, then I prefer like to define these options in a JSON file like `constants.json`, feel free to define "constants" in node, which way do you prefer?