controller: Genereate examples WIP: Refactor

Signed-off-by: Jesse Stuart <jesse@jessestuart.ca>
controller: Generate examples WIP: Fix flag with which output file is opened

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

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