Fixes & tests for surrogates support in strings encoder/decoder
Moved utf8 border detect to utils, fixed bugs & added tests