Refactor the push() and pull() implementations so that API additions needed for remote-execution is made easier. #454