Direct and inverse scattering transforms with arbitrary spectral singularities