Adding the observer pattern with some tests for it.