Refactor DBus code out to class, clean tests