Remove giant switch and macros in favor of more concise logic
Merge pull request #2440 from yebblies/modmerge

[DDMD] Remove giant switch and macros in favor of more concise logic