fix saving location ids to SQL in m4change, move common code to helper functions
Merge pull request #2788 from SolDevelo/M4CHANGE_3

Pathfinder/m4change - fix saving location ids to SQL in m4change, move common code to helper functions