ir: Add a few utility functions for dealing with lists of variables.
semantic: Add a wrapper function create instances and call ctors.