partially addresses #688

This addresses a few of the points in #688. I'd like to get this merged now and will continue adding new features in another pull request as I might not have time to work on this over the next few days, and the new features here are pretty stand-alone.