Don't declare encoder if not used.

If the encoder wasn't used in a function, the Go compiler would not compile the file.
Merge branch 'jsondump' into jsonfmt

Need the bug fix for not declaring js when not used.