sort chats, send by id

Refactor to display chats sorted by most recent, while preserving list order. To accomplish this, refactored ImsgHandler to class, stored chat id's. Messages then sent via appscript, using id.