First stage in major plugin system refactor
Massive refactor, stage 2