Restructure output of ApiExpandTemplates

Create a new output format of ApiExpandTemplates and deprecate the old
one.

Change-Id: Id12cbe4aeaa39bea382cf3b78810589bb1c9368f