Mixin that adds observer functionality to an object.