move scanner reference counter to erlang process; move long-lived scanner instance to editor