Add some helper functions for use by upcoming changes in the Sugar shell.
And use it in the sugar3.mime modules. This allows to get rid of the pygtk generated sugarbase module, along with the wrapping code. Also add more cases to test_time to make sure everything is still working.