Switch to public OCP API

Change use of core functions to the public OCP API using the following script:
https://gist.github.com/ogasser/6833462

Fixes owncloud/apps#1236