Slight refactor of projectName handling.

I'm going to want to know the projectName in several new places
shortly, so storing it in a member var.

For bug 39790

Change-Id: Ia222a7678a8a02e845257b0f5dbace06b6930c8f