Support for multiple template repositories

A working first stab at support for multiple template repositories. Main aim is to allow for internal company repositories so that company specific templates needn't pollute the public repository.
so I think this code is broken, it needs to throw ResolveTemplateException only in the getOrElse below if there's no headOption, but the trick is we want to keep the causing exception - I think this code block just needs to be restructured. Also, we should not try any more downloads once one is successful, unless we do them all in parallel.