Tides and the Evolution of Planetary Habitability