Refactored xively and added nconf for api credentials.