Make repository URL optional and add validation

Repository URL is now optional. Add validations for URL formatting. Fix
bug where URL is sensitive to trailing slash.