Learning Singularity-Encoded Green's Functions with Application to Iterative Methods