Added a 'mode' variable that is used to specify whether the execution is...

... 'dist' or 'watch'