Sparse factorizations and scalable algorithms for differential and integral operators