Convert OC_Config to object so it can be used for DI

Also add unittest. And make it possible to temporarily change the config returned

@Raydiation @DeepDiver1975 @MTGap @karlitschek @icewind1991