Update valid and dirty statuses

Update valid and dirty statuses, toggling css classes of CodeMirror
container, based on ngModel validity and dirty status