Move internal state records to their original modules.

Records that expose internal implementation should not be into the .htl file.