Added ability to wrap resource with a class through a callback. Updated example.php and README.md