Using electronic health records to quantify and stratify the severity of type 2 diabetes in primary care in England: rationale and cohort study design