cleaned up thread.c and added thread_get_nice