add explode and implode functions

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