Added some of the supporting code for getThreadList. Function is not finished yet, however.