Added npe check
Fixed merge conflicts
yaml: accept $brooklyn:sensor ref'ing non-entity

- Previously the class referenced in $brooklyn:sensor had to be an 
  entity.
- However, other classes (e.g. policies such as ServiceRestarter) 
  also declare sensors, so relax restriction.
Merge branch 'npe' of https://github.com/dave-finnegan/brooklyn into misc
tidy of MongoDB client NPE check (as per discussion in #1327), and clearing isRunning on stop
improve logging for longevity tests
refactor EntityCleanupLongevityTest so that (1) it checks explicitly that things have been cleaned up, (2) we have a unit test as well as a long-running test, and (3) the long-running test makes memory assertions; currently explicitly excuses certain leaks (which we want to patch soon)
reply to code review comments, method now called `isMostlyEmpty`
Merge pull request #1339 from aledsage/fix/yamlSensorAcceptAnyClass

yaml: accept $brooklyn:sensor ref'ing non-entity
Creates MemberReplaceable

- DynamicCluster extends MemberReplaceable
- ServiceReplacer works against MemberReplaceable, rather than just
  against DynamicCluster
- ControlledDynamicWebAppCluster extends MemberReplaceable;
  means one can associate ServiceReplacer policy with this, rather
  than against the child DynamicCluster (almost).
ControlledDynamicWebAppCluster extends DynamicGroup

- group members of ControlledDynamicWebAppCluster mirrors members of
  child DynamicCluster.
  This allows policies such as ServiceReplacer to be associated with
  ControlledDynamicWebAppCluster, rather than having to be against
  the child DynamicCluster.
ControlledDynamicWebAppClusterTest: non-integration

- Change some of the tests to be non-integration by using a stub
  AbstractController.
- Have just done the quick-wins; more could be converted.
http: allow configuring of connectionTimeout
WebAppMonitor: add waitForAtLeastOneAttempt
EntityTestUtils.assertAttributeEventually: return val
HASensors.FailureDescriptor: add toString
JavaWebAppSoftwareProcess: common util methods
Adds BashCommands.waitForFileContents
Adds copyResource variant with `boolean createParentDir`
Tasks.resolveValue: deep introspect set/iterable