Extract opaque_keys into a separate library

[LMS-2571]
Merge pull request #3862 from cpennington/external-opaque-keys

Extract opaque_keys into a separate library