This improves docs in some of the public header files, cleans up and improves some of the example code, and fixes a couple of pedantic warnings in places.