Mtrace tool, merging from experimental branch