Refactor towards supporting struct compares.

    Still not supported, but it should be easier to do now.