Port logging, platform-specifics, path setup, partial multilingual support.
Also handle cleanup more sanely.