fix bug 1032013: refactor the way watched repos work

I ended up needing a small refactor to handle things properly.  Also
optimized the code a little.
Merge branch 'master' into fix-watched-repos