Added support for new closure and destroy attributes from which we can determine which callback a parameter belongs to.
This is just code being moved around, there are no real code changes.