png: make the encoder configurable

In order to support different compression levels, make the
encoder type public, and add an Encoder method to it.

Fixes issue 8499.

LGTM=nigeltao
R=nigeltao, ruiu
CC=golang-codereviews
https://codereview.appspot.com/129190043

Committer: Nigel Tao <nigeltao@golang.org>