Change class lookup to use the common code. Implement domain function evaluate and domain variable ref.