This patch fixes watch registration through the config file and a broken log line when the watch registration fails. It also plumbs all the watch loading through a common function and tweaks the
unit test to create the watch before the reload.
When a -dev agent is restarted it'll have a clean state, including a
reset index. A watch() will reconnect after a restart, but it won't
notice that the index counter has reset and it will keep waiting until
we reached the old index again, which is wrong. Resetting the index will
prevent that and makes watch work for -dev agents.