Move server detection for App Lab to start of script and set server constants there.