Implementing lua.state