Canonicalize collections in builder pattern (not finished yet)

for testing
Wait a minute, @andreistefanescu you should review pull request https://github.com/kframework/k/pull/915 instead. I created this pull request only for testing. So it contains several commits which belong to another pull request. Thanks.