Haxe 3 version

I migrated the code to Haxe 3 using the [Migration instructions available on haxe.org](http://haxe.org/manual/haxe3/migration) and the latest [Haxe API reference](http://api.haxe.org/).
It compiles just fine and all tests seem to pass.