Restructured tests and examples.

Change-Id: Ie500f9aa99e9901215c0858112b7851485eb442f