Rotational Dynamics and Evolution of Planetary Satellites in the Solar and Exoplanetary Systems