Structure and thermal evolution of exoplanetary cores