The popup menu is now created from DOM

No doubled menu in source html anymore.
Escaping issue reported by hazardous on irc solved.