Catch up 1.7

Several recent changes were made to the 1.6 branch only. (Everything after a06cd5188da8d0078dbf03ba05d09fb397c3de5a)

This catches the 1.7 branch up.

@odininon  this should be clean and is ready if it is.  If it is no longer a clean merge, please let me know.