Move internal struct from charset header to source

Also, rearrange and tidy the header.