added base class for threaded plugins, split up dirs