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 could be wrong (in which case tell me why), but I think this could cause breaking bugs.

Wouldn't `JSON.stringify(it.text[0])` be a lot better? (Obviously, you'd need to remove the surrounding `"`.)