Minor code improvements:

- use brackets for print statements for py3 compatibility
- use range instead of xrange for py3 compatibility
- None comparison should be done with "is" or "is not"
- use core-like Page.text and Page.save() instead of Page.get()
  and Page.put()

Change-Id: I5121135024c8fc89dc50a4e969adef5d861c5e6f
Merge "Minor code improvements:"