Fix workers & download page

The current check for the environment:
```js
var self = (typeof window !== 'undefined') ? window : {};
```

The issue is that in workers `window` is undefined.
Therefore, in the first line, `self` will be set to `{}`.

This will destroy the check for workers later on:
```js
if (!self.document) {
	if (!self.addEventListener) { // <- this will be true
		// in Node.js
		return self.Prism;
	}
 	// In worker
 	// ... <- this will no be executed
}
```

because `self.addEventListener` will then be undefined (due to `self = {}`).

The fix is to make the check for the environment more sophisticated:

1. check for the browser: `(typeof window !== 'undefined')` - use `window` as `self`
2. check for a worker: `(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)` (from http://stackoverflow.com/questions/7931182/reliably-detect-if-the-script-is-executing-in-a-web-worker) - keep `self` as `self`
3. assume we are in node - set `self` to `{}`

Fixes #302