Design of the cold and thermal neutron moderators for the European Spallation Source