Replaced dynamic_cast with obtain_from_generic in FITCInferenceMethod class

And also added test case for checking marginal likelihood derivatives.