Added beforeHook option and task/target options merging
Made the options object merge with the target configuration so that the latter can override the former