libcgc: Add utilities for encoding instructions

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
libhost1x: clean up command stream a bit

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>