Draft modulestore refactoring for opaque keys
in order to get test_publish to work.