Improve tests

The most interesting part in this PR is the last commit which adds a test script for ipfs init.
This test script uses the IPFS_DIR env variable as suggested by @jbenet in issue #204.