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