Porting to haxe-3.0

Some easy and fast changes to make it work with haxe 3.