Refactor, remove comments

Hide most initialization behind an initialize function and restructure
the steps such that set_defaults need not take arguments.

Add some (very) simple helpers so the imperative main steps read a
little more nicely.
Don't parse URLPath from rpc response