Create URLTool from URLUtil

Separate main() into tools/URLTool and library into util/URLUtil
Improve main() by buffering decoded input.
Tidy code.