Defaults undefined params argument to {}
Defaults cb to params and params to {} if params is a function