Make docker compatible with the new registry

These changes will allow docker to push and pull using the new registry API.

A few details probably need to be ironed out before it's 100% ready but this version should at least provide the same set of functionality its predecessor had, plus some more things.