thread.py with clean_message

thread.py with clean_message. Examples are in the updated thread ipython notebook.