Update extend and augment functions, and add documentation.