Refactor DeploymentMonitor.setDeployment.

Move _eventListeners to constructor. Check for an existing deployment before set a new one.