Regorganized code to now fetch publish/retrieve logic from a repository
type.

This will allow different repositories to have different types of
authentication/upload procedures. Hopefully to make it easier to have
private repositories with different storage/auth procedures.