cache relevant expressions inside repeats, closes #151