Allow a user to configure the number of retries

This would also fix #38 by using the new Kazoo API for that. However, the minimal working version of Kazoo needs to be bumped to 1.3.1 (see the second commit).