refactored webrouting env detection again, closes #218