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.
I know you didn't write this code, but I wonder whether the choice of DFS is appropriate here, vs BFS. I suppose the answer is likely to rest on the average course structure, and on what level of block this is being called on.