Arrow images are backwards in source header

* Added a fallback for checking rtl vs. ltr if the DOM is not yet finished. If it's finished the result is cached in the boolean variable.
* Renamed the variable IS_RTL to isRtl.
* Refactored the code that removes and adds CSS class names.
* Removed duplicate CSS.
* Fixed transition, background position should not be animated.
* Reduced time from .25 to .2 since 200ms is the jQuery default for fast animations.

Bug: https://bugzilla.wikimedia.org/show_bug.cgi?id=61308