NEXUS-5591: Local mode and proxy mode handling corrected

Initially these two modes of a repo (and proxy repo) were
mishandled. This change now implements proper handling of
those and extends tests covering it.