webpage.sendEvent: Be sure that the browser have the focus
webpage.sendEvent(): it passes more tests

PhantomJS produces unexpected DOMEvent when sending
some events. For example: a keypress DOM event is generated
when sending a keydown event. We don't want reproduce this
kind of bugs.
Transform the webpage JSM module as a CommonJS module
Transform the webpage JSM module as a CommonJS module. part 2

There is a serious Javascript bug with JSM module that
are imported into an empty object: strings passed to function
of a JSM module are not decorated as a String object, or probably
are "frozen". We cannot access to properties and method of
a string parameter.

The only solution is to convert the JSM to a CommonJS Module.