Re: How to address a Shihan, Sempai, or Sensei?
Shihan is not used in addressing the person. Sensei is used.
As for Yudansha that are teaching. This varies by dojo. Ask a senior member of the dojo for their etiquette.
For a quest teacher, they will usually be introduced by your Sensei. Use whatever title your Sensei address them as.
My personal belief when visiting a dojo is you can never be too polite. I err on the side of over addressing a person. They will let me know if I should use their name instead.