So it turns out ModLoader already does this.

Cue me removing a whole bunch of code that I actually felt good about
for once :/