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'm not too sure what you're referring too here… Maybe this will make more sense once outlined in the style guide?