Coding standards

@gnarf It's up to you whether we land the second commit which reduces this to the necessary code for what we need to support. The first commit gets the current code to match our style guide.