Use dynamic environment in activation record
This change is compatible with base code and solves #27,
it would not be necessary with static scope but it doesn't hurt.