An Algebraic Theory of Observables