pescan: Attempt to get rid of global variables.
Remove unnecessary header files.