Selectively merged some of RlonRyan's pull request, including some work towards #8