Re-implemented support for using --grid flag rather than --loginuri to select server.