Add basic loadtest scripting

There's only so much you can do to loadtest a single-endpoint system, but this does what it can :-)
PR includes fixes for a couple of small bugs I found from an initial loadtest.

@SamPenrose r?