config: validate that module variables can go to ints, convert [GH-624]

This fixes #624. It adds validation to configuration that module variables are strings or can WeakDecode to strings, and also does that proactively.