Refactored local/remote switch; Additions to the local pivothandler
tests