support bitbucket.org

I've cherry-picked commit from issue #12.