Split the main workins out into a module.

This will allow the creation of a parallel upload-pack command.