Rework of b64 encoder into more general encoder object