WIP: implement group access enforcement in courseware

@andy-armstrong @cahrens 

@dmitchell @cpennington - FYI - some performance optimizations still being worked on in here, but would appreciate any feedback / guidance on the overall logic which isn't planned to change.
this change (and the next one in this file) are measures intended to placate some tests that are failing with the changes on this branch, though not doing so successfully.  can omit from review for now.