Finished polishing up, with master branch changes

Doing this cleanup by hand, hope to cherry pick on the other branches.