The init template now uses typeof checks, rather than inspecting the window's properties.

Fixes #2