CocoonJS compatibility
Merge pull request #480 from ekelokorpi/dev

CocoonJS compatibility