reimplement XMPP connection

This commit reworks the way that the XMPP connection takes place; in
particular, we replace iterparse with our own XML event handler, which allows
us to poll for messages without blocking on the socket.

This has several benefits:

    - it allows us to more easily implement polling of jobs via the REST API
      (which is necessary for some users for whom XMPP notifications are
      unreliable - issue #48)

    - it allows us to better monitor the state of the XMPP connection, and
      reconnect it if it should fail - issue #41

    - rather than establishing a new connection between each job, we can use
      one long-running connection, which eliminates the race condition whereby
      jobs may arrive between polling the REST API and establishing the XMPP
      connection
move xmpp stuff to another file
Send XMPP keepalives every 60s
remove a couple of bits of debug code

Poll for jobs before making xmpp connection, so that basic functionality still
works, even when xmpp auth fails
fix 'invalid argument' errors
Deal with comments raised by armoo in pull request:

* Create new logger for xmpp
* Put doc comments in the right place
* Fix method naming to be consistent with rest of code
Collect and consolidate the various timers in the app.

Poll period when xmpp is working, and when it is not, plus
the keepalive ping time.
Raise keepalive period from 1 to 10 minutes.

Research suggests that 1-2 hours is fast enough.