Move edit stuff out of .wiki to .edit

Move code that is required by both to a new .util module.

And gosh oh golly, write a test for the edit stuff.