Partial oauth implementation.
threading added to writing message.