fixed bug with corrupted long messages in unicode
gen_esmse and gen_mc reworked for asynchronous work