Implemented log buffering.

Added appengine.flushLogs API.