Cleanup: Add toDeviceMotionEvent and toDeviceOrientationEvent.

Adding toDeviceMotionEvent and toDeviceOrientationEvent conversion functions to replace static_cast, and update toWheelEvent and toGestureEvent so that they accept NULL argument for consistency.
In the earlier CL, the comparison for Event.interfaceName() was being done with EventNames::<event>, which is wrong.
The interfaceName() should be compared against eventNames().interfaceForDeviceMotionEvent.

BUG=None

TEST=None; no behavior change;

Review URL: https://codereview.chromium.org/26429003

git-svn-id: svn://svn.chromium.org/blink/trunk@159671 bbb929c8-8fbe-4397-9dbb-9b2b20218538