Extract options and a callback function from arguments