Tighten up a few spots to run on SES

window.Error is a read-only property under Caja, so assigning to it fails.  Igor also says it was hurting after gzip.

Assigning to undeclared globals is prohibited in Caja (and ES5 strict mode) so I added "var"s at the beginning of some "element = ..." statements.