Update code to match changes in the documentation

Not all changes are incorporated, but specific issues were created to address sections of code that are not yet up-to-date (primarily to support new features).