7.x coder standards

Coding standards and some small fixes see the commit notes for more information.