Turn side-effects into a function

As discussed in #2.  README updated.

Can you update ert-runner accordingly?