Remove calls to beforePhase for type-checks entirely. Further, enforce nesting rules for classes extending js.Any

Fully par-tested on top of 8f777c93d42d99f5746c059668f0c4a1264a3e60