Eigenfunctions of the Curl Operator, Rotationally Invariant Helmholtz Theorem, and Applications to Electromagnetic Theory and Fluid Mechanics