Working towards MVVM.

Clearing things up.
Re-working.
Changed the way the dialogs will be created.