Code cleanup, better bitbucket support.