put referrer map into env, complete test cases for 'set' and 'reset' keywords