Add helpers for compiling metadata

This adds the helper functions necessary to identify if we need to compile metadata and to compile the metadata

/cc @ivey @KAllan357