Add value name table

This PR adds a value-type-name table and a function to get a value
type identifier from a string.

It also adds a arithmetical macro as helper.
Would prefer a downcounting while loop, but this is just a matter of taste.