MDL-34345 user_preferences: Implemented new API that makes use of the cache API

Conflicts:

	lib/tests/moodlelib_test.php
MDL-34345 user_preferences: Conversion to new API in core