Add merged changes.

Add changes merged from Dan's original repository.

This is a first attempt at merging changes between forks. If it works it will put us on the road to keeping things in sync.