Add automatic reaping of old files
Fix exception on Firefox UX

Running encryption on UX would occasionally result in an exception being
thrown for whatever reason. This appears to fix it by only enlarging
Emscripten's memory when absolutely necessary.