Completed merging of 059dcc936e55d8473a3a683162a7d6e5ce3af3f8. Tests passing. Not yet ready for prime time yet. Needs more testing and cleaning.