treemd: rework of the interface, fixed encoding to utf-8