Clean up some goofy hack-ish code from the early days...  This also makes
it a lot easier to open the plugin format to other developers...