Fetch code using js and refresh_token using api-client gem

fetch_access_token logic as per the documentation at:
https://developers.google.com/glass/develop/mirror/authorization