Move setup code to global.R out of server.r