darcs_buildbot.py: refactor to enable import and testing