Add support for courseware partitioning based on cohort.

@andy-armstrong @cahrens 

suspect i'm going to need to wire something into stevedore - @andy-armstrong ?

please take heed of the notes in the first commit message - there's a database migration needed. 
I'd break this into multiple tests rather than having one complicated test with a very long description. I find it easier to understand a single named test, and any failures will (might) be clearer.