Some fixes

   * Improve npm error catching (issue #24)
   * Manage patch with empty folder (issue #25)
   * Write readable json file (config and stack)