Big cleanups, still a few things to work out.
Compilation works now, but still a few IError cleanups to do.