Validation on the replacement pattern of rewrite rules

Mantis: 0003197
Use the messaging utility for Domains
fix missing validation on integer preferences

which failed a test
also adapt the domain test to the new login path
adapt peering test to recent changes
adapt more tests

all tests are now succeeding again
(with firefox, chrome, htmlunit and phantomjs)
use the message utility for all controllers