Added thread control structure and active threads array.  Collapsed mailbox deletion from main.