Reimplemented get_failures

It was not working for the case where there is a
faiure directory with no keys.

I also reimplemented it to reduce code count
and wrote tests.
Merge pull request #15 from bodepd/get_failures_fix

Reimplemented get_failures