Issue/master/pup 798 watched files

A refactor of #2181