Fix up fs.watch functionality

Not ready for commit yet.   Doc improvements to follow in a subsequent commit.
In the interests of being able to write tests against this code, it would be much preferable if this block of code (lines 82-103) was moved into a function and so too was lines 106-123.