add explode and implode functions

This replaces #1444, rebased and updated for the recent shortcut.cpp changes.

Adds explode & implode function as described in the aforementioned PR.