Singleton objects need to be created in the singleton factory rather
than as a global variable so that they have a unique object per
context in order to allow multiple tests to run in parallel.
Test: go test -race ./...
Change-Id: Ib6912849e1b849ffe8646882cfb476ddea6c6b55
Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.
Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063