Clean up generator code further

- Pass `this` into runtime function so that the function is called with the right context. Removes the need for `$that = this`
- Use an alpha renamer for `arguments` and detect if `arguments` was present.
- Move shared code to super class.
- Remove unused imports.