Fix IE8 problems with unit tests

Gonna try to fix the problems IE8 has with our unit tests.

(WIP, do not merge yet.)