Complete refactor, 22% faster now in v8 (aka nodejs)