Validate template variables/don't print "undefined"

This checks to make sure template variables are typeof "string", otherwise prints a blank value to prevent unintentional type conversion.

This fixes an issue where a user with no location set gets the title/tooltip "Name\n\nundefined".

I have tested this and it appears to be working well. Please let me know if there are any issues.