Re-factors to use Promises/A+ and stores handle in config.json.