add --trace option and beforeJob/afterJob hooks