Updating for 4.1 

There are a number of changes for 4.1 - mostly taken care of by Ian Duffy. See commit messages.