Fixes to get the Ninja build working and the unittests running.

This doesn't quite fix everything, as I'm waiting for a GYP patch to land upstream and we'll need to roll DEPS.
While this gets the unittests building, a bunch of them are failing and need to be looked into.

BUG=
R=sebmarchand@chromium.org

Review URL: https://codereview.appspot.com/153910043