added a hash table to memoize rename and mark operations.

this should make renaming and marking less appallingly slow.
detect unused attrs in one more place, s/fatal/err for all
typo in span_err, merge with other
added rename, mark, and resolve fold fns