function uriToUrl(uri) {
    var parts = uri.split(':');
    var repoParts = parts[1].split('/');
    var repoUsername = repoParts[0];
    var repoName = repoParts[1];
    var repoPath = repoParts.slice(2).join('/');
    var branch = parts[2] || 'master';
    if (parts[0] === 'gh') {
        return "https://raw.githubusercontent.com/" + repoUsername + "/" + repoName + "/" + branch + "/" + (repoPath ? (repoPath + "/") : "");
    } else if (parts[0] === 'bb') {
        return "https://bitbucket.org/" + repoUsername + "/" + repoName + "/raw/" + branch + "/" + (repoPath ? (repoPath + "/") : "");
    }
    return uri;
}
Supports "nice" URIs for packages:
- full URLs
- gh:username/repo (for github)
- gh:username/repo:branch
- bb:username/repo (for bitbucket)
- bb:username/repo:branch