Bug 1061215 - [Messages][Refactoring] Improve handling of remaining chars counter. r=schung

ok, I still think what I said before: we should try to uncouple the view change from the state change. We can do this using the existing "segmentinfochange" event but I'm open to other possibilities.

I don't like that it's called here because we call "updateType" to update the state.type property and it has a side-effects of updating the DOM. Moreover "updateType" is sometimes called when time the segmentinfo information is not ready yet (because segmentinfo retrieving is throttled).