controller/examples: Refactor addr discovery

Signed-off-by: Jesse Stuart <jesse@jessestuart.ca>
controller/examples: Refactor output prep.

Signed-off-by: Jesse Stuart <jesse@jessestuart.ca>
controller/examples: Use json.NewEncoder

Signed-off-by: Jesse Stuart <jesse@jessestuart.ca>