Turn line-read loop into coroutine, remove some cruft
Apparently working server shutdown and restart
Make all device.on_* methods return futures