Add generic handler support for variables.

Now it has 2 limitations:
1) it is called twice - for length calculation and for actual value;
2) it works only with variables enclosed into curled braces, e.g.
${VAR}
Use traditional so versioning.