add lock_guard to protect against data races in initialization of scripting environment
rename function names to reduce camel case noise