refactored retrieval of agents from dynamic groups

- moved complex session overrides into a function that wrap the
  impersonation of arbitrary function execution.
added phpcs ruleset

This ruleset will actually check the followings:
- 3 spaces for indentation (excluding comments)
- reports of Cyclomatic Complexity (helpfull to detect methods to
  refactor)