Supports Node 0.8-0.12 by using Nan.

This patch is not ready yet, as the goal was to make it compile first, rather than restructure / test.