first pass at actual internal->utf8 conversion (bugs)
fix some edge cases in utf8 output logic
simplify end-of-string handling by iterating through NUL-terminator (kind of hacky but safe assumption for use with lua_tolstring results)