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).

Fixes #1