[BUILD] Update Rakefile with procedures to check presence of bzr and hg.