semantic: Remove refrep and fold functionality into exptyper.

I also fixed import test 24 and aggregate test 10
while doing the refactoring.
ir: .dup function type parameters when copying to a delegate.