feat(lua): improve error handling in Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(kernel/environment): make the environment throw an exception when weak-ref has expired

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): add type_inferer object to Lua API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>