Removed third party packages from pull request. Other refactoring.

- PEP 8 Style changes.
- Reorganized code into library package and modules.
- New dependencies: google-api-python-client, httplib2, oauth2client, uritemplate.
- Fixed logging.