Test speedup merge

PR #34 and PR #36 merged after diversion and cleaned up some more. Now it should be possible to fast-forward master against this.