Implement hash() function and some supporting expression evaluation code