refactor flatten
polyfill.io throws error, suggest es5-shim instead
Merge remote-tracking branch 'origin/next' into next