Cleanup permalink generation

Fix permalink generation to not contain various smells. See verbose description in the last commit in this PR.
@dkubb Good catch. I'll actually make the specification of a prefix mandatory, since there is no valid call side without a prefix.