CH-1164 Added drush command to get segments

Also, added response code check to getSegments and more complete error handling/error reporting
We'll need all other calls to this method wrapped in a try/catch now that this throws an exception.