Mostly just zapping a bunch of duplicated code; the only interesting thing going on here is the changes to the performance counter implementation.