minor refactor, added a little source-test, cleaned up locking
Merge branch 'master' of github.com:cmyr/haikubot