Several code improvements for safety, performance and less redundancy

Not already tested.
Mainly should prevent crashes because of too long fontnames on windows and let *strip-tags.lua* erase empty brackets too.