use more compact representation when used as JSON

This pull request enables marshalling/unmarshalling bitset into JSON as URLEncoded string.