Cleanup Lua Frameworks

This closes #949 and provides some general cleanup for the Lua codebase. All Lua tests now pass