Recognise more things as constant

Will merge after 2013-05-09T12:00:00Z if no complaints.  This should improve run-time performance by recognizing more attributes as constant.