Updated links to use an object structure instead of an array when only one link is present to better conform to HAL

Also included an indentJSON method for PHP < 5.4.0 via http://recursive-design.com/blog/2008/03/11/format-json-with-php/ (slightly modified).