Massive restructure to allow common files to be shared between server and client

Saves me time!