Bug 971460 - Refactor path_append/prepend to accept multiple elements

* Add functional tests