Refactor the Iris driver code which opens/closes internal/external ports. (dm)