Implemented a better isInstanceOf that's 2 times faster than the haxe implementation.