Change formdata default encoding to utf8 and related refactorings