Turn ClassOf(cls) into a Literal.

Most of the changes are just about moving the `case ClassOf(_)`
to its new rightful place, near the other Literals. The other
changes are removal of the ClassOf case altogether, where the
generic Literal case already does the right thing.