refactor move to python-modules
This makes docker-registry work when backed by S3. It's the same patch applied in the docker upstream container image. Backported from boto/boto#2932