StringUtils::parseVariables no longer accepts variables with $ sign - e.g. {$foo}.
Refactored it to make use of anonymous function callback.