Break out URL building and add a DOI validation. Properly escape params fed into URL. Also add some basic level of testing.