Export Google-internal library

Exporting the Google-internal CAP library as submitted at HEAD. Also, fixing the CAP validator to be compatible with it.

The new CAP library has a bunch of new features, bug fixes and validation heuristics. More details to follow in the notes of the upcoming release.
Thank you, very good catch. This is code that shouldn't be commented out. I'll send an update to this change.