Handles connections using xmpp_time

This update is complementary commit which updates the controller code to handle connection logic by using the xmpp presence time to determine when to create a new connection. This update also uses the json-based stats.