Changed namespace of Agent to .Agent
Inject dependencies to poller
Simplify thread static management for AgentEnvironment.