Split RGC message creation into its own function

This is something we'll want to reuse from fixup scripts.

Change-Id: I9c703783a054617f11a0155099fe9a233dd87182
Merge "Split RGC message creation into its own function"