Add getRemoteTask/Event methods and refactor isInRemote