Wrapped all scripts in required 'check' function, fixed scope issues, resolved complexity limits in complete script, and added comprehensive tests.
This resolves the 'Function not found' error by explicitly wrapping methods in closures, ensuring proper type handling for custom types in Rhai.