Pulling in Headnet's nodejs implementation.