Switched from xively-python to requests. Some refactoring.