Factor out the discover logic to the test module

This avoids duplication in sugar and sugar-toolkit-gtk3
makefiles.
Move setting AT_SPI_CLIENT to discover

It needs to be called as early as possible before unit tests
has a chance to import gtk.

Hopefully will fix random test failures we are seeing in buildbot.
Fix ObjectChooser backwards compatibility

The last change brak compatibility with the use in activities
without set the filter_type parameter, because None is not
a allowed value in the dbus call.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>