Move http/https switch hooks to server_chain. (part 1, code)
Move http/https switch hooks to server_chain. (part 2, files)
Fix hook priorities.