Reorganizes bot code into client/server