ResultPlan and related constructs have already been written in a type erased
fashion. This commit takes advantage of this by moving the details of the code
to ResultPlan.{cpp,h}.
This slims down SILGenApply.cpp in a NFC way and ensures that other code in
SILGenApply can not depend on the details of ResultPlan. Also it is my hope that
this can become the beginning of the merging of the ResultPlan from SILGenApply
and from SILGenPoly. We should only have 1 way in SILGen to build applies and
create apply results.
rdar://29791263