Refactor package structure.

Split dialogs and frames into separate packages, moved all application
code into application package.