TD Bank has pledged $2 billion toward affordable housing, affordable mortgage lending and other investments aimed at supporting lower-income communities in the state, under a partnership announced this week with two influential advocacy groups.