Reorganzing things a bit.

Since there are custom classes and plugins, I need a bit more robust
structure here.