title: Electron main process modules access to app
body: <p>So I need some work done in my main process. And I made some external class for it. In main process js I have:</p>
  
  <pre><code>import ApiClass from './api/apiclass'
  
  global.api = new ApiClass()
  </code></pre>
  
  <p>One of api methods need to save data in path. But apiclass seems to be unable to resolve app of main process. For example:</p>
  
  <pre><code>import {app} from 'electron'
  const path = app.getPath('home')
  </code></pre>
  
  <p>Gives me:</p>
  
  <p>Cannot read property 'getPath' of undefined</p>
  
  <p>Importing remote in ApiClass also gives me undefined. I understand that remote is the only way to access main process from renderer. And it seems to be undefined in main process. But how can I access app from submodule? 
  I don't want to path electron methods result to ApiClass conctructor, because if api changes I should change main js as well.</p>