DeviceOrientationControls.js: Minor code performance optimizations and clean-up