refactored webrouting env detection again, closes #293