Provide an interface to manage plugins, and add some Unit Tests

Add Unit Tests for Plugins, User and Permissions.