Fix workers

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) {
		// in Node.js
		return self.Prism;
	}
 	// In worker
 	// ...
}
```

because `self.addEventListener` will then be undefined (due to `self = {}`).

The fix is to make the check for the environment more clever:

1. check for the browser: `(typeof window !== 'undefined')`
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)
3. assume we are in node
Don't set the `self` variable with `var`

Firefox directly shadows the global variable `self` if it is present (= in a worker). So we need to set `self` without `var self` but directly.
Merge pull request #304 from apfelbox/worker-fix

Fix workers & download page