Fixed Optional Activities so that there are methods that will return not-null min and max value - makes the optional activity display code easier. The client should ensure that the values aren't null but they are allowed to be null in the db so we have to cater for that.
Fixed bugs in getCountActiveLearnerByLesson, changed calls to update lesson to use the lessonId rather than the lesson. Change allowed us to reduce the amount cached in the context.