jslib: Move instance initialization

Do not initialize variable too early. They're set either on window
or attempted to be done on undefined - which causes crash.
Merge pull request #34 from noseglid/master

jslib: Move instance initialization