Persist column size with localStorage. Various bug fixes

1) Persist column size with localStorage.
2) Fix [length-1] array access (bug: column sizes not properly restored).
3) Check object and function existence before usage (bug: resizing window results in JS error)