Quadrature Approximation Of Matrix Functions, With Applications