Refactor some code in common.py

This will allow the addition of a timeout to run_shell_command
Add a timeout option to run_shell_command

Defaults to None. Behavior of the function is unchanged when
timeout=None
Add timeout argument to VCS checkout() and update()
Add unit test to exercise git checkout timeout

It uses a TCPServer that doesn't send anything. Any ssh client will hang
for a very long time when connecting to such a server.