Added master mode tests

And a simple script for generating reference files