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.
I'm not entirely sure why this is needed. But the whole thing stopped compiling on my machine. Thoughts?