Maybe fix a bug that is causing mouse capture to essentially be disabled when playing a scene via the editor.

This probably introduces another bug which will need to be sorted.
Fix some math bugs in the scripting environment.
Fix a bad rendering bug where having multiple shadow-casting lights of a particular type is broken.
Modernize some scripting stuff to use math.vec3 instead of individual floats.
Fix a couple more rendering bugs.