Refactor transform_type so it's not mutually tail-recursive

* Factored out the control flow of transform_type/2 into foldm_either.
  foldm_either/2,3 returns on the first successful transformation and
  otherwise accumulates errors. This means that
  transform_supported_type/2 and transform_extended_type/2 don't have to
  manually call transform_type/2 with the remaining list on failure,
  instead simply returning {ok, V} or {error, Reason}.
* transform_type/2: Since is_supported/1 and is_extended/1 are mutually
  exclusive, I converted the case with tuples into an 'if'. This looks
  cleaner to my eyes.
* transform_supported_type/2: Converted the case with an internal 'catch'
  into a try with pattern-matching. 'catch' has been known to perform
  less well than try/catch and the syntactic result more clearly calls
  out the exceptional case.