Add Constant class.

Continuation from #882 
Let's see what happens.
I'm using this in JUnit tests. The code won't look too good if I delete this constructor.