Add "changed" function

Add the "changed" function that emits 1 if the value have changed, 0 if None or unchanged.