Added plugin handling and other stuff