Improve py3k compatibility for Viewer core widget and OverlayPlugin.

Dictionary keys are treated differently in py3k, causing the Canny plugin to not work on py3k.  This addresses two such errors, allowing the Canny plugin to work on Python 3.2 (tested with Ubuntu 12.04 32-bit).

This addresses #892.