First pass at test cases and minor code changes for ConstantExpression.

Could handle the "needWholeDocument" assertion here.  This is included in the class defined in Dependencies.js, which may or may not be merged yet.