pattern search now takes opts using a struct. pattern search also accepts parameter to pass to objective function