[r=Rocky]Generated tests and const expressions

Implemented const expressions with tests against the reference implementation.

I've only tested the `make gentests` target on my linux machine. May or not work for osx, highly doubt it for windows. It takes about 3 seconds to generate all the tests cases, and this will only get worse. I think its best to commit the generated files and update them as they change.

Thoughts?