Misc AVM1 fixes

- Adds global 'flash' object
- Implements registerClass
- Changing order of child/variable resolution

Affects #571