Improve certificate model code quality

Does what it says on the tin! `Certificate` is now a C:

https://codeclimate.com/repos/519228b056b10279600066b5/compare/feature-improve-certificate-model-code-quality

@Floppy Can you review this and merge if you're happy?
Indent `when` as deep as `case`.