Quarkonium and heavy flavour production in Run I and first results with 13 TeV data at CMS