Heterogeneities at multiple length scales in 2D layered materials: From localized defects and dopants to mesoscopic heterostructures