Factor out stdin parsing and test
Factor out and test url retrieval