util: pull Buffer code out of VNC module