dag: miscellaneous fixes

Move import to top and do not require all parsed arguments to
have an 'args' member.

Signed-off-by: David Aguilar <davvid@gmail.com>
settings: factor out read_json and write_json

Signed-off-by: David Aguilar <davvid@gmail.com>
settings: do not load during construction

Make settings loading explicit.  This makes this class simpler so that
we can inherit from it for session handling.

Signed-off-by: David Aguilar <davvid@gmail.com>
settings: add a session class

Add a way to save per-session state data in
~/.config/git-cola/sessions/.

This is a pre-requisite for #164.

Signed-off-by: David Aguilar <davvid@gmail.com>
sessions: add support for the X session management protocol

Add a -session argument and implement QApplication::commitData so that
git-cola remembers its state across logout/reboot.

Closes #164
Closes #244

Suggested-by: @MagicMuscleMan in #164
Helped-by: @Koblaid in #244
Signed-off-by: David Aguilar <davvid@gmail.com>