use nan for cross-version support.

closes #1