Modulestore Support for Content libraries (Part of SOL-1, SOL-2, SOL-3)

@cpennington @dmitchell @doctoryes @antoviaque @explorerleslie @cahrens

**Background**: This is the technical foundation required for [Content Libraries](https://openedx.atlassian.net/wiki/display/SOL/Content+Libraries). It is considered part of SOL-1, SOL-2, and SOL-3, with the corresponding UI changes separated out into #6046.

**Discussion**: Architecture discussed extensively on [the wiki](https://openedx.atlassian.net/wiki/display/SOL/Content+Libraries) and in meetings, then the revised proposal was presented to the [Arch Council](https://openedx.atlassian.net/wiki/display/AC/Architecture+Council) on Oct. 21 and given thumbs up.

**Partner information**: 3rd party-hosted open edX instance, for an edX solutions client.

**Merge deadline**: ASAP - several other PRs are ready and blocking on this.

**Dependencies**: Requires edx/opaque-keys#46, which is already merged.
@cpennington CourseLocator uses `course`, while LibraryLocator uses `library`. [`replace` implementation](https://github.com/edx/opaque-keys/blob/master/opaque_keys/__init__.py#L320) throws `KeyError` if passed a key that is not on `KEY_FIELDS`.

So, to use `replace` type check is still needed to determine `course` / `library` key + sanitization of `index_entry` of other fields. This yields shorter (in terms of line count) but a bit more cumbersome code, so I decided to keep this, as new version still depends on type check.