Fix pipeline caching

Improves performance somewhat (14.3 -> 13.6s with Obama on my laptop,
vs. master).

Change-Id: Ie4c58c3eae448eb7b6c00661852a28060e8b53f0
Don't serialize nodes in assert

Profiling showed that this assert used about 9% of our total CPU time. Instead
of serializing each node, only do so if the assert fails.

With this fix (and another in domino, which likely doesn't matter), Obama now
parses in 11.5s on my laptop, down from 13.5s.

TODO: use env.log?

Change-Id: I7b44d4d72c6a922ec432dcff1471e6842907572c
Merge "Fix pipeline caching"
Merge "Don't serialize nodes in assert"