Add validation of variable name strings

Signed-off-by: Michael Buesch <m@bues.ch>