MDL-34397 Caching course format in modinfo

Also by passing the  object to sectioninfo constructor we save a query retrieving course format
MDL-34397 Object section_info calculates expensive data on demand only