Initial commit of code, not currently functional and fairly messy, need to move the server into a non static context