changed command "npm test" - added options "check-leaks"; fixed global var leaks in tests