Real-space approach to the multi-component envelope function problem in semiconductor heterostructures