Move sh stuff to module, fix ping.

It seems the native pythong ping stuff is breaking after a few minutes,
so this simply uses system ping.