Refactored addNote directive to use note2 data structure via pseudoclassical constructor function.