Ps unit tests

Seemed like this would be sort of mundane but there are actually a few dragons here.
Unit testing turned up the fact that we make use of methods in psutil that are deprecated! (#9301)