Update/merge tests with new master branch.
Reformat/clean-up so to be closer to upstream style.