Also cleaned up crufty code and added tests.
We have to add a new file, because the original table tests don't look for this.