Large refactor using maps, better extends

Most of this is a straight refactor, generated output is the same however there are a few additional extends and surgical classes.
I can dig the idea of using these class names directly on an element, although there is a strong argument as to why we shouldn't do that (semantics). If that's the rationale, then I agree.

However, I don't really understand how using these extends makes our code more 'modular and performant'. Perhaps an explanation offline might work better.