Reverse order of class / sites check

Some classes are completely irrelevant for some sites. By changing the order
we don't need to handle each site in every class.

Change-Id: Ibebc56cbfecd2a808d5a216d9bbc045120080163
Merge "Reverse order of class / sites check" into production