Porting revertbot.py from compat to core

For Google Code-In
Replaced imports and deprecated query.GetData calls

Change-Id: If77ba53e6905b3f1cc2b4dba75af492fd2bb5d18
Merge "Porting revertbot.py from compat to core"