Move state_dir to tor_persist and start to implement it
state_dir is still quite incomplete. Further work depends on sorting out Slug (#1192 (closed), and now !1912 (merged)).
I've made this MR now because it has a fair amount of code motion and refactoring. The remaining work for #1163 (closed) will be more self-contained I think, so it makes sense to deal with this prep now.
Closes #1205 (closed)
Edited by Ian Jackson