Get rid of sh module in worker code

Is not available for Windows.

Also use Python platform agnostic functions instead
of shell Unix commands.