Extract edge-runner
Improve edge-runner and add much-needed tests