rewrite join-str with better implementation; add tests for it