Couchbase code tidy, nicer way to define sensors, and prevent NPE's, using new `Functionals`

addresses comments in #1473