Using web workers with chained promises in angularjs using a shim