Switching codec to use generated types and better enc/dec logic.