[NRY] fix up Buffer's handling of all the encodings

Mild overhaul to finish up Buffer encoding work started with the UCS-2 branch.

[Currently failing some tests…]