dumpVar: only available in dev mode
The way C modules are initialized was affected by one of the major breaking changes between 5.x versions. Rather than trying to cater to each version individually, we now just backport from newer versions. Namely from 5.2 to 5.1.
Even between minor versions, Lua simply removes or renames functions.
The stack setup for callback threads was all over the place, and pretty messed up.
This provides a way to query the current state for the primary data structures, as well as common setters.