Fix orientation tracking

This uses resize events and height vs. width comparisons to determine orientation, instead of relying on orientationchange and window.orientation (which don't work on Crosswalk).

Tested on Android Crosswalk.

Fixes #1