Split PAM encoder off into its own file.