Allow global 'window' without mocha-phantomjs

Even if 'window' is defined this may not always mean that mocha is
running via mocha-phantomjs. This commit avoids making
`require('./base')` mandatory in case 'window' is present.