Move compatibility functions to compatibility.js and add two more.
Merge pull request #2767 from owncloud/js_compatibility

Move compatibility functions to compatibility.js and add two more.