Unit testing of ps exec module.

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!
Lint.
Merge pull request #9303 from cachedout/ps-unit-tests

Ps unit tests