Add checking of identifier before direct inserting to URL.

This provides initial identifier validity and allows
avoiding quote() of all URL component.