Haxe3 support

Fixed the cpp issues. Everything seems working :)