Implemented the rest of the plugin manager to ensure proper deallocation of objects