hashcodes: fix order in foam generation to match axiom
Also use new hash codes in foam test