clone: split out layer url bits, sanitize urls

Signed-off-by: Christopher Larson <kergoth@gmail.com>