IdTable was not accessable from mail.messageThread() because of closure scope limitations. 

Added getIdTable() function to access it.

I've added the simple tests under the demonstration/ folder.
Run the idTable_test.js for the original version and you'll see that the idTable is {} in both cases.
Run the idTable_test_new.js for this version I pushed here and you'll see that the getIdTable() function returns the messages.