add new-style cast, the type is passed as 2nd param
Refactored declared_state as a scripted function
creating a value of type 'any' results in null
dynamic_method is now a bytecode op
Add tests for closure inputs
remove unused 'errored' function
fix closure calling to have proper input checking