improve DOM/javascript layer for phaser.io support

Little additions on the javascript bridge, for better touch/canvas recognizing. 
I've tested for Phaser.io game engine, but maybe there are others that depends on those modifications.