Move static member functions out of a class.

Because compare() and its heper functions no longer have to be members of
LayoutPass class, we can remove it from the class. No functionality change.