Avoid 'unsafe-eval' code to comply with C-S-P

Content-Security-Policy does not allow eval-like mechanisms, unless the
'unsafe-eval' keyword is specified.

Fixes issue  #1904.