cleanup

- Removed unnecessary headers in main.
- Put unnecessary headers in queue.h
- Removed unused function do_work_on_pid
- Renamed function do_work_index to do work