[WIP] Move ajax calls in versions app to OCS API calls

:warning: work in progress :warning: 

Added OCS API calls for the versions app and make the JS side use them

Fixes https://github.com/owncloud/core/issues/10571
We might just want to add this to https://github.com/owncloud/core/blob/master/core/js/oc-requesttoken.js - developers should not need to care about this.