Refactor the custom tooltips example to fix problem where custom tooltips weren't properly defined in Firefox. Fixes #347