Implement 'expand' built-in helper.