Added $extend functionality to expressions