Upgrading numAttr to a testUtil

We use it in a bunch of places and it seems general/useful.  Let's upgrade?