If `defaultVals` hasn't been passed then `defaultOrKey` will be interpreted as a default value that will be set on the `k` key of the settings object. If `defaultVals` has been passed then `defaultOrKey` will be a key of the `defaultVals` object and if a default is needed for `k` key in the settings object then it will retrieve the default value at `defaultValue[defaultOrKey]`.

Actually, we can just do an overloaded version of this to make it clearer. For some reason I thought it would mess up since the way overloading works in JS, but it should be fine.