Dump and emit constants via the GlobalContext.

Since constants are managed globally via the GlobalContext and not
through the Cfg, it makes sense to emit them via the GlobalContext, in
case they need to be emitted outside a function.