Threads

Adding thread.py and Threads.ipynb.  Both are now working properly. Functionalities of thread.py is described in the docstring in the file. Threads ipython notebook in the example folder illustrates some of the information that can be extracted out of threads of messages.