Use a more specific match for changing worker/prefork

Adds tests to and closes #258

Also corrects cgid/cgi mod behaviour discovered during testing.