refactor group controller and agents controller package management into a package manager service that can be passed a group or agent