move structure boilerplate together
replaced set equality fun with MapEqFn

MapEqFn is defined in lexluthor/lib/lib.sml