Study variables and variable dialog button state fixes

Custom buttons were switched to use "synchronous" loading, because app
currently needs better control of code execution order, to decide if
certain buttons are visible or not.
Merge branch 'master' of https://github.com/Tietoarkisto/metka