Testing gravity with CAMB and CosmoMC