Handle cell formats correctly during sort.

Unfortunately sorting becomes noticeably slower when cell format is
enabled.  Perhaps a future project.

Change-Id: Ieb02b207b62df343d1f667a8075874b7688ee9a7