Big reorg around plugin architecture

Not completely testing, but should be working. Will deploy tomorrow and
get bug reports.