Remove the use of std::dyanmic_pointer_cast, which does not seem to work with Emscripten.
Change emscripten to allow memory growth and attempt to build with exceptions.