Massive Updates and refactoring.
Moved all dialogs to handler.