Adding Constant class and ProductionReference as a superclass of TermCons

This allows for better error reporting in the new parser when having ambiguities.
It will also allow for more simple disambiguation filters.

@dwightguth please review. We talked about this change a while back, and now I got to it.
Basically now the new parser outputs only two types of objects: TermCons and Constant, bot having a reference to the production from which they come from.
Can you be more specific?
I don't see anything wrong with the way IntelliJ generated them.
Note that I'm expecting `sort` and `value` to not be null. I'm fine with getting a NullPointerException. It means it is something wrong in some other part of the code.