Move to a managed Lua implementation

Fixes the current disposal crash on OSX and sidesteps a potential AccessViolationException crash on Windows when using the native Lua.
The Lua dlls are again custom with dangerous bits supposedly disabled by me, similar to what we have now with MonoboxedLua. See me/KopiLua and me/NLua for my forks with the edits.
Has some Lua code refactoring as an added bonus.
Closes #4170 and #4204