Add Constant class.

Continuation from #882 
Let's see what happens.