Initial merge investigation

DO NOT MERGE THIS YET.

This is an investigative PR to see what the diffs are between the WAM version and the CA version. Each change when ready should be put into a separate PR on a separate branch and merged in to one or both of the upstream repos.

There is a bit more history under PR#1, but I have copied the final comments over from there to here so that I can have a clean master branch.