Sort messages by time, not just order inserted into collection
Make appcache actually work