BREAKING COMMIT: Large refactor using maps, better extends, etc.

WARNING: THIS CHANGES QUITE A BIT OF EXTEND AND VARIABLE NAMES, AS SUCH IT MAY BREAK OLDER INTERGRATIONS. USE SHA: 409e661d1eb8845e3678b4e098f194b830b7a841FOR OLDER VERSION.

Most of this is a straight refactor, generated output is the same however there are a few additional extends and surgical classes.