Slightly refactored MultipartEncoder + improved unit tests