Add Tkinter variant, along with some refactoring

Remove obsolete ui/common.py.