Stage2

Another stage of merging my large pull request.