Call mainFun even if window and document aren't defined
Merge pull request #1241 from joshvera/main-js

Call mainFun even if window and document aren't defined in javascript runtime