Move metavariables to the kernel. This is the first step for implementing the new elaborator.

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