Re-wrote function to a class

Config file now parsed as default, otherwise overridden by params.