The infrared universe: The cosmic evolution of superstarbursts and massive black holes