Since Nightmare updated to use Electron (Chromium), it is no longer able to run headlessly without Xvfb.
So let's reimlpement this with WebDriver + PhantomJS! (Another option was pure PhantomJS.)
Bot login and running works.
Bot 'already logged in' check not tested. It currently doesn't work because cookies are broken in PhantomJS 2.x. Probably could test with Firefox...
REPL does not provide response correctly. WebDriver does not provide output. PhantomJS does not correctly clear console logs after fetch, so we can't just dump them to the terminal either (it repeats previously dumped logs).
Login probably needs to be tweaked to work on SO chat... SE chat login works differently. I'm not sure if we can safely unify them, since SE chat has a different login mechanism from the rest of the network - and the old Nightmare method of logging into SU, etc., doesn't work reliably because there's a variable wait involved for the StackAuth SSO scripts to load.
Since Nightmare updated to use Electron (Chromium), it is no longer able to run headlessly without Xvfb.
So let's reimlpement this with WebDriver + PhantomJS! (Another option was pure PhantomJS.)