Bug 1035170 - Rewrite SWF parsing to a scan-first, parse tags on demand approach

`window` is undefined in the shell, i think this breaks shell testing.