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.
Yes, all repositories must have a name (in order to prevent conflicts, etc. templates etc. are stored under their own repository directory)
I thought that made things simpler, but I'm happy if you feel it's better a different way?