Move ajax calls in versions app to OCS API calls

Added OCS API calls for the versions app and make the JS side use them

Fixes https://github.com/owncloud/core/issues/10571
I'll update the doc inside the API class...