PHOENIX-933 Local index support to Phoenix

Moved the changes outside of scanOrdered/scanUnordered and passing through necessary info through calls.