Move json below xml so that xml is the default

This is necessary to support older clients which don't request a
particular content type and expect XML.
Add support for JSON format responses
Add some basic testing of the files controller