Create server.lua

Currently only determines whether it's the MASTER or SLAVE but it works