misc tools/shared improvements
preparations for emscripten-ports support; #2404