[JENKINS-23330] Spaces in project names are not encoded on <tr> IDs

Hello

I was curious to see if I could contribute to the jenkins project, so I started with a bug classified as 'trivial'. Here's my proposition to solve it. I wrote two functions (with unit tests :-) ) but used only one, because I'm unsure if the problem should be addressed for HTML4 or for HTML5.
Looking forward to your feedback!
Regards,

Dominique
These should not be part of `Job`, as there can be other kinds of `TopLevelItem`. Maybe a static method in `Functions`, which is available in Jelly as `$h`.