[improved] split-up of specific functions used in play.html (beamng-play.js) and global interface (beamng.js)