Remove unused variables in ctm.newQueryState

Allows the same code to be reused by stm_yv.newQueryState
Ensure that the model-derived data is in an appropriate type
Fix bug in fallback Python code for scalarProductOfSafeLnDot

Despite the function name, I was using log() instead of safe_log()
Initial set of updates, still broken

Main issue appears to be related to V, and its effect on R_Y. R_Y has a
negative determinant.
Temporarily simplify the STM-YV test for debugging.