Refactor plugin API and isolate admin commands to a separate plugin