Media device states

Send updates to the back end about the current media device state and some cleanup.