diff --git a/MasterPassword/Web/js/Makefile b/MasterPassword/Web/js/Makefile
new file mode 100644
index 00000000..d2a2e2a2
--- /dev/null
+++ b/MasterPassword/Web/js/Makefile
@@ -0,0 +1,15 @@
+build: mkdir-es5 es5/mpw-js/pbkdf2.js es5/mpw-js/scrypt.js es5/mpw-js/mpw.js es5/setImmediate-polyfill.js
+
+mkdir-es5:
+ mkdir -p es5
+ mkdir -p es5/mpw-js
+
+es5/%: $*
+ babel $* -o $@ --presets es2015 --source-maps
+
+clean:
+ rm -rf es5 2>/dev/null
+
+update:
+ git submodule update --init --recursive
+ git submodule foreach git pull origin master
diff --git a/MasterPassword/Web/js/README.md b/MasterPassword/Web/js/README.md
new file mode 100644
index 00000000..26ed7468
--- /dev/null
+++ b/MasterPassword/Web/js/README.md
@@ -0,0 +1,8 @@
+ES5
+===
+
+If your browser does not support ECMAScript 6, you will need to run babel to compile an ES5-compatible version of the ES6 mpw-js code.
+
+1. Install npm. On OS X, you can use `brew install npm`.
+2. Install babel. With npm installed, you can use `npm -g install babel-cli babel-preset-es2015`
+3. Build the ES5-translation of the ES6 code. From this directory, just run `make`.
diff --git a/Site/mpw-js/js/dependencies.js b/MasterPassword/Web/js/dependencies.js
similarity index 81%
rename from Site/mpw-js/js/dependencies.js
rename to MasterPassword/Web/js/dependencies.js
index 78b23676..a45fd67d 100644
--- a/Site/mpw-js/js/dependencies.js
+++ b/MasterPassword/Web/js/dependencies.js
@@ -1,3 +1,13 @@
+// Test for required ES6 features
+// Use an eval call to avoid a hard-fail on ES5 parsers.
+var ES6 = false;
+var esdir = "es5/";
+try {
+ // Use ES6 code if the ES6 class, let, destructive assignment and rest arguments are supported.
+ eval("class $ES6 { constructor() { let b = true; this.b = b; } } var [ES6, esdir] = ((...args) => args)(new $ES6().b, '')");
+} catch (e) {
+}
+
// If crypto.subtle is not supported, try crypto.webkitSubtle instead.
if (window.crypto && !window.crypto.subtle && window.crypto.webkitSubtle)
window.crypto.subtle = window.crypto.webkitSubtle;
@@ -12,9 +22,8 @@ if (!window.crypto || !window.crypto.subtle) {
document.write("