GenBCode refactoring (remove Tracked) and fix InnerClass / EnclosingMethod attributes

The largest commit, "Remove Tracked, ...", was already reviewed in #3855. It is a squashed version of the commits labelled `[squash-after-review]` in that PR.

The subsequent commits address the review comments. They should be reviewed.

The commit "Fix InnerClass / EnclosingMethod attributes" is new and should be reviewed.