Merge in Trinidad 1.2 code and fix conflicts - code has not yet been tested!

32 files changed