Cleaned up imports.  Added ability to retain state on rotation.