dialog.open() and close() now return promises
Debugging phantomjs timeouts