Exploiting gradients and Hessians in Bayesian optimization and Bayesian quadrature