split gcolor3.c across multiple files plus code cleanups