JSONfeed doesn't distinguish between tags and categories, so I've combined them. However, because of (I think) the lack of boolean "or", I split this into two parts, one of there are Categories and possibly tags, and another if there are only tags.