A mathematical model of plants as ecosystem engineers