Changed string parsing to use the Buffer class in node.js, this fixes the problem with string length for non-ascii characters