Factor out common metadata prologues

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>