Changed how the script handles failure causes. Now only failed and unstable
builds are searched for user-defined failure causes. Also improved some
methods for handling results and failure causes