Add metavariable utilities. They will be used to refactor the elaborator.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>