Simplified and generalized idle-time handling as follows:
- Removed g.app.afterHandler: g.app.idleTimeHook does the same thing now.
- The timer callback now calls g.app.idleTimeHook() if it exists.
- g.enableIdleTimeHook now has the following signature::
    def enableIdleTimeHook(idleTimeDelay=500,idleTimeHandler=None):
if no idleTimeHandler is given, g.idleTimeHookHandler is used.

Here is an script illustrating the possibilities.  Do the enable-idle-time-tracing command  before executing this script::

'''A script illustrating interacting idle-time handlers.'''
class Handlers:
    def h1(self):
        g.trace()
        g.enableIdleTimeHook(1000,self.h2)
    def h2(self):
        g.trace()
        g.enableIdleTimeHook(500,self.h1)
h = Handlers()
if g.app.idleTimeHook:
    g.disableIdleTimeHook()
else:
    g.enableIdleTimeHook(1000,h.h1)
Changed signature of unitTestGui.setIdleTimeHook to make unit tests pass.