Return watch function and support watchign dir/modules.