remove apm dependencies and add threadpriorityhandler.cc