MTree and ipc merge refractor

now working outside programming interface