Merge Ian and Moniz branches

Let's get our two sets of code to agree.