Characterizing the ecological and evolutionary dynamics of cancer