Reimplemented object ID replacement in a more sane way.
Merge pull request #702 from alexjacks92/IdsToPaths

New implementation of replace ID.