#96694 use app engine authentication api

And some minor style improvements.