More work on refactoring fragments and dialogs to be more abstract and modular.

Gone through all dialogs and fragments. Much more abstract and general now. More work still to be done though.