Split-up and rewrite of the discover_tasks() method, so the logical steps
are not all tied together, and so we have better starting place for further
changes.
The discover 'reaction' in the task configuration can now be like:
{discover: { repo: 'URL of the git branch to clone', branch: 'branch to clone, master by default', fallback_branch: 'what branch to clone if `branch` can not be cloned', base_dir: 'relative path to a directory in the repo. The path is used as root for the task discovery' } }
I'm not sure the fallback_branch is necessary, but the previous code had
a concept of checking out 'master' when the provided branch could not be cloned
so I wanted to introduce a way to do the same, but explicitly.