Bug 921417 - rewrite build/variant.py in javascript -- version 2
1. use forEach, every
2. keep temp/app/data folders
3. fix the wrong checking logic of cached app
4. use OS.Path.join to join all path