Tidying Up

This is a lot of small code consistency/style things, but I'll leave comments for bigger changes.