Merge "Fix code accounting bugs, track external app data." into oc-dev
am: 4b32f7c676

Change-Id: Ie14bf66fd93d6c461983a5232d4164c815cb56b7