downloader: verify resolution string

Add some sanity checks to make sure that the resolution string is
sensibly formed and some tests which exercise this.