A fast spectral Galerkin method for hypersingular boundary integral equations in potential theory