Switch custom passes to be IRMutators

Also includes some cleverness to hopefully avoid split heap woes on
Windows.