rudimentary implementation of scope, $watch, and $digest (chapter 1)