Infrared factorization, Wilson lines and the heavy quark limit