Primes of the form x² + ny² : Fermat, class field theory, andcomplex multiplication