Ticket thread revisited

Address issues related to attachments (issue #472)
Implements ticket thread class