refactoring toggleColumns for extrenal rendering

@spmason Please have a look at this... re-factoring in preparation for rendering this standalone.