Prospects for measurements of rare B decays and other heavy flavour physics at CMS