Migration for Haxe 3.1.

I removed almost all extern classes here; -net-lib should be used instead. The only things that are remain are the HUGSWrapper utilities, and a few iPhone-specific unity externs that -net-lib isn't picking up for some reason.

I'm not sure if we should merge this into master, or if it should remain a separate branch. 

- [x] @lpetre 
- [ ] @ogles Part of Haxe 3.1 migration