Added functional state change.
Convert the states to objects.
Add children templates.
Added grandchildren states.