Added support for line feeds at EOF to JsonEncoder