prefer when over .then
Merge pull request #980 from AnalyticalGraphicsInc/fixDataSourceErrors

Properly call error event and reject promises when data sources fail to load.
Merge branch 'master' into dataSourceBrowser