Structured Scopes and Registries for BB+

This branch represents the functionality required for BB+ (structured scopes + trusted registration).  The clinical API endpoints have been stripped out.

Needs code review + serious cleanup, but I'm hoping this functionality can make it into the 1.1 release.