You'd need the ECU from a D40 as well as some of the instrument panel. The D40 uses a dial to select driveline mode, rather than a lever. You'd also need to add the TF relays to the IPDM/ER near the battery and hope that the wiring loom has all of the needed wiring for that.
Not sure how much has to change up front, you have to mount the diff and will probably need a suspension change in the mix.