Copy downstream code from previous commits by JHilker and cddr.

Commits:
- 40ab61cfc30741394ae027b47d049fa24cf58dcf >> JHilker
- 552e15d05b4b176f59911e38301d6634845b313a >> JHilker
- f1889754132405210f4d71817cc46e8b03a9e6aa >> JHilker
- dc623de0063e5aca0253784bcbc5186f04501915 >> cddr
Merge pull request #3 from where/copy-downstream-code-from-previous-commits-by-AndyChambers-and-JHilker

Copy downstream code from previous commits by cddr and JHilker