made cleaner internal format for charsets
now uses cleaner internal representation for charsets
adding extraction of character sets in JSON format