Migrate mostly everything but file watching from loader.py to pluginmanager.py