Made dialogs draggable by their titles

Transfer of #142.
Fixes #141.