10x performance improvement replacing indexOf with a simple map

After profiling a test code I've noticed indexOf function was consuming a lot of CPU. I've replaced it with a simple javascript map and my test code is now running 10x faster. My test is basically a PING/PONG application. I've created it to figure out many functions/second dnode was capable to run.