Class to convert a string to a map of character to frequency