Compatibility fix for php5.3

In PHP 5.3 you cannot refer to $this from the lambda functions (NLSClientScript:449).
To fix this you should define variable, e.g. `$that` and pass it to the lambda function with `use`.