Improve support for OSC 4 by cleaning up parsing code and adding support for reporting 8-bit color rgb values. Issue 3007