Added Fife Ventures specific code to CDNResource/Origin.php and User.php

This has the extra functions and a couple of bug fixes from the Fife Ventures fork of the PHP wrappers. Not much changed really (same as the merge for 3.0 but 3.1 had already cleared a lot of the patches we'd needed to port back to our forked version)