Major code clean-up, approved by TSC This reverts commit e2051cca. Change-Id: I567a594bebfe56e31f68df92a828839a56948223