Add the ability to output badges as JSON.

As discussed in issue #264, here is update to allow outputting badges as JSON. This took a little bit of "hackwork", since the entire system is designed to output images, not plain text. Nonetheless, it seems to work very well. Simply use `.json` a the file extension, and the data is returned as JSON. I've also added the CORS header right away as well.

Note, the "any badge" feature will not work with JSON, as that makes no sense.
I should note that I wasn't able to test this particular line of code, since I wasn't sure how to trigger an "unresponsive" request.