Added idempotence test and improved travis-CI config.