Add command structure to example code

Add some simple command structure to the example code.

Change-Id: Ic226fe0910b9f29b995402bab23dffa2bf5d5f08
Merge "Add command structure to example code"