First stab at promisifying the repl (contributed by lookis)