Fix computation of objective function in OSR if covariances are specified

Due to the preprocessor adding entries for all variable combination into i_var, variables contained in covariances obtained a wrong weighting. By only selecting the unique entries, this cannot happen anymore. Moreover, the computation intensity of the objective does not increase quadratically in the objective anymore.
Add unit test to check whether objective function matches and whether covariances actually work