Added camera smoothing.
Reorganized some code, fixed some state transition errors.