Non-backward compatible change to conform links to HAL format

Instead of an array in the JSON format for links, it's just a single object per link rel. Also, I added a json parsing library from http://recursive-design.com/blog/2008/03/11/format-json-with-php/ for PHP < 4.3.0 and I'm not sure about the license. Proceed with caution.