TiVo improvements to as3hx

Hi,
here are improvements to the tool made while converting TiVo codebase to Haxe.

Main changes are:
- as3hx now generates Haxe 3 code
- many improvements to the generated coding style to make the generated .hx closer to the original .as
- fixes on edge cases

Sorry for the code dump, we weren't sure when/if we would submit the changes,
so please let me know what I can do to improve this PR