Bug 1084298 - [Messages] Decoupling the all inputs query logic from DOM tree structure

- Add map for each view for maintaining the data for rendering/selection
hmm it's good move when leaving the panel, but if we move the messages into the threads(for example, thread.messages), which means we can caches messages, not sure if it's a idea to keep it for rendering next time.