Initial import of code from compat + live hacks

Code provided by Krinkle from what was on tool labs, which was
running from a SVN checkout.

Change-Id: I9d4a4cf358880492fe457c98c1af4bc8b2746388