Re-implement the 'implode' function so it's more efficient.
Some other minor tweaks to lib.fs (e.g., formatting).