Add memory usage tests

Port memory usage tests from Kefir. Adds also diamond shaped stream and
combineTemplate test cases form PerformanceTest.
Print variances
Merge pull request #376 from lautis/memory-tests

Memory usage tests