Feature/x3 repeat

This implements the repeat directive just as in spirit v2.