The neutron star in Cassiopeia A: equation of state, superfluidity, and Joule heating