split paging api into files, added todo list
split some thread API functions into separate source files
split some thread API functions into separate source files
added state pull and push and reap