Fix unit tests - July 15

- Most site don't have a server named 'kmn' - use localhost
- Avoid pulling in QT commands just to get a threadsafe rand()
- A scaffolding file defined the same function twice