Creates a server or client RPC handler depending on if we're in main or some other process