[MNG-4633] Fixed weave mode bug when building m3 itself in weave mode. Updated testcase for MEP. Also removed all unused/unecessar code from weave mode.