Fix #1685: Remove col.index from most code, add col.uid

Tidies up much of the column behaviour.

Removed col.index everywhere it appears, except for in the cell content
templates.  For the cell content, replace with col.uid, which is now
uniquely generated when the column is created, and never changed again.

Should also fix #1694, but need to push to be sure.