Move handling of (un)setting templates vars/funcs to xbps-packages.

This way new variables/functions can be added to templates without changing
xbps-src at all and it still works.

Bump to v112.