Plugin Sync: Rewrite code for file search and create. Store the fileId to localStorage and limit retry count to ease API usage.

It has better error handling to avoid unnecessary call to Google API.