GetEmitOutput function and testfiles

`writeByteOrderMark`