Expression bug fixes and optimization
- Re-implement cached states in expressions, and invalidate the cache for functions of structs if the this-nss differs (used when looping an array of structs)
- Added test for this
- Fixed some error messages in the expression subsystem