Refactor objc -> js conversions.
Use same conversions for generating arguments to callbacks as generate_retval.