Haxe3 migration

Haxe3 compatible